Option Explicit

Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
Dim curDir
curDir = fso.GetAbsolutePathName(".")
'fso = Nothing 

Dim shell
Set shell = CreateObject("WScript.Shell")
Dim sysEnvVars
Set sysEnvVars = shell.Environment("SYSTEM")
Dim envVarValue
Dim tokens
Dim token
If shell.ExpandEnvironmentStrings("%PYTHONPATH%")="%PYTHONPATH%" Then 
	envVarValue = curDir
Else
	envVarValue = sysEnvVars("PYTHONPATH")
	tokens = Split(envVarValue, ";")
	envVarValue = ""
	For Each token In tokens
		If Len(token)>0 And LCase(token)<>LCase(curDir) Then
			envVarValue = envVarValue & token & ";"
		End if
	Next 
	envVarValue = envVarValue & curDir 
End If 
sysEnvVars("PYTHONPATH") = envVarValue 
WScript.Echo "PYTHONPATH = " & envVarValue
'sysEnvVars = Nothing
'shell = Nothing
